<div ng-init="init();" class="kmi-layout-content SMT11-content" ng-class="[tab_mode,detect]">
    <div class="kmi-header-row">
        <div class="kmi-side-btn left" ng-click="back();">
            <i class="material-icons">&#xE408;</i>
            <div class="kmi-can-click"></div>
        </div>
        <div class="header-title" ng-bind="'SMT11.title' | translate"></div>
    </div>
    <div class="kmi-layout-main-content">
        <!-- 基本資料 data -->
        <div class="kmi-row-fields data">
            <!-- 使用者資料 data_user -->
            <div class="column-item left data_user">
                <img src="image/icons/person.png"></img> 
                <label ng-bind="user_name"></label>
            </div>
            <!-- 環境資料 data_environment -->
            <div class="column-item right data_environment">
                <label ng-bind="('home.env' | translate) + envInfo"></label>
            </div>
        </div>
        <!-- 主要流程 process -->
        <div class="process">
            <div class="process_model" ng-repeat-start="phase in phases"
                ng-click="BackToPhase($index)" ng-class="PhaseStatus($index)">
                <label class="process_item" ng-bind="'SMT11.'+phase | translate" ></label>
            </div>
            <i class="material-icons process_arrowIcons" ng-repeat-end ng-if="!$last">keyboard_arrow_right</i>
        </div>
        <!-- 搜尋掃描欄 qr-code -->
        <div class="kmi-row-fields barcode_content qr-code" id="input_barcode">
            <img src="image/icons/search.png"></img> 
            <!-- <input class="qr-code_input" mdl-barcode="input_barcode(barcode)"/> -->
            <input class="barcode_input value input_plot" readonly="readonly"
                ng-keypress="input_PDA_barcode($event);" ng-model="barcode" hidekeyboard="true" />
            <div class="qr-code_icon" ng-click="QRCodeScanner();">
                <img src="image/icons/QRCode.png">
            </div>
        </div>
        <!-- 主要內容 SMT11_main -->
        <div class="SMT11_main" ng-show="item_list.length == 0">
            <!-- 工具類型 tool_class -->
            <div class="kmi-row-fields main_fields">
                <div class="column-item">
                    <label class="label main_item" ng-bind="'SMT11.list.tool_type' | translate"></label>
                    <label class="value" ng-bind="tool_class"></label>
                </div>
            </div>
            <!-- 工具編號 tool_no -->
            <div class="kmi-row-fields main_fields">
                <div class="column-item">
                    <label class="label main_item" ng-bind="'SMT11.list.tool_no' | translate"></label>
                    <label class="value" ng-bind="tool_no"></label>
                </div>
            </div>
            <!-- 工具狀態 tool_state -->
            <div class="kmi-row-fields main_fields">
                <div class="column-item">
                    <label class="label main_item" ng-bind="'SMT11.list.tool_state' | translate"></label>
                    <label class="value" ng-bind="'SMT.common.state.s_' + tool_state | translate"></label>
                </div>
            </div>
            <!-- 最後保養日期 last_mantain_date -->
            <div class="kmi-row-fields main_fields">
                <div class="column-item">
                    <label class="label main_item" ng-bind="'SMT11.list.last_mantain_date' | translate"></label>
                    <label class="value" ng-bind="last_mantain_date"></label>
                </div>
            </div>
            <!-- 壽命上限 life_count -->
            <div class="kmi-row-fields main_fields">
                <div class="column-item">
                    <label class="label main_item" ng-bind="'SMT11.list.life_count_limit' | translate"></label>
                    <label class="value" ng-bind="life_count"></label>
                </div>
            </div>
            <!-- 累計使用 acc_count -->
            <div class="kmi-row-fields main_fields">
                <div class="column-item">
                    <label class="label main_item" ng-bind="'SMT11.list.cumulative_usage_count' | translate"></label>
                    <label class="value" ng-bind="acc_count"></label>
                </div>
            </div>
            <!-- 使用上限 usage_count -->
            <div class="kmi-row-fields main_fields">
                <div class="column-item">
                    <label class="label main_item" ng-bind="'SMT11.list.usage_count_limit' | translate"></label>
                    <label class="value" ng-bind="usage_count"></label>
                </div>
            </div>
            <!-- 目前使用 actual_count -->
            <div class="kmi-row-fields main_fields">
                <div class="column-item">
                    <label class="label main_item" ng-bind="'SMT11.list.currently_usage_count' | translate"></label>
                    <label class="value" ng-bind="actual_count"></label>
                </div>
            </div>
        </div>
        <!-- 維護項目流程 SMT11_maintain -->
        <div class="kmi-list SMT11_maintain" ng-show="item_list.length > 0">
            <div class="kmi-list__row-content">
                <div class="row-content" ng-repeat="item in item_list track by $index">
                    <!-- 項目 & 圖片 -->
                    <div class="kmi-row-fields">
                        <div class="column-item left row-title" ng-bind="item.cm_order + '. ' + item.cm_item"></div>
                        <div class="column-item" ng-show="item.sop_path !== null" ng-click="open_checkPic(item);"
                            style="position: relative; width: 28px; height: 28px;flex: initial; display: flex; justify-content: center; align-items: center;">
                            <i class="material-icons">insert_photo</i>
                            <div class="kmi-can-click"></div>
                        </div>
                    </div>
                    <!-- 類型 -->
                    <div class="kmi-row-fields">
                        <div class="column-item left">
                            <label class="label" ng-bind="'SMT11.list_detect.item_type' | translate"></label>
                            <!-- 範圍 -->
                            <label class="value" ng-show="item.cm_type == '1'" ng-bind="'SMT11.list_detect.item_type_1' | translate:item"></label>
                            <!-- 開關 -->
                            <label class="value" ng-show="item.cm_type == '2'" ng-bind="'SMT11.list_detect.item_type_3' | translate"></label>
                            <!-- 文字 -->
                            <label class="value" ng-show="item.cm_type == '3'" ng-bind="'SMT11.list_detect.item_type_2' | translate"></label>
                        </div>
                    </div>
                    <!-- 檢測內容 -->
                    <div class="kmi-row-fields">
                        <div class="column-item left">
                            <label class="label" ng-bind="'SMT11.list_detect.maintain_value' | translate"></label>
                            <input ng-show="item.cm_type == '1'" ng-click="changeValue($event, item);" ng-model="item.input_value" readonly="readonly"/>
                            <div class="check-point-switch" ng-show="item.cm_type == '2'"
                                ng-class="{'is-selected': item.input_value == '1'}" ng-click="switchValue(item);" >
                                <div style="width:24px;height:24px;"></div>
                            </div>
                            <input ng-show="item.cm_type == '3'" ng-model="item.input_value" style="margin-right: 32px;"/>
                        </div>
                        <div class="column-item right" ng-show="item.cm_type == '1'">
                            <img src="image/icons/not1.png" ng-show="item.is_ok == '0'">
                            <img src="image/icons/check1.png" ng-show="item.is_ok == '1'">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 關閉按鈕 & 開始檢測按鈕 & 確定按鈕 -->
        <div class="kmi-mobile__btn-content" style="justify-content: space-around; display: flex;">
            <button class="kmi-button__mobile ng_prev" ng-click="back();">
                <label ng-bind="'SMT11.close' | translate"></label>
                <div class="kmi-can-click"></div>
            </button>
            <button class="kmi-button__mobile" ng-click="startDetect();" ng-show="item_list.length == 0">
                <label ng-bind="'SMT11.start_maintenance' | translate"></label>
                <div class="kmi-can-click"></div>
            </button>
            <button class="kmi-button__mobile" ng-click="confirm();" ng-show="item_list.length > 0">
                <label ng-bind="'SMT11.confirm' | translate"></label>
                <div class="kmi-can-click"></div>
            </button>
        </div>
    </div>
</div>
